//
//  ChargeTableViewCell.m
//  MaskMachine
//
//  Created by yuanyuan on 15-3-19.
//  Copyright (c) 2015年 hanjiaxue. All rights reserved.
//

#import "ChargeTableViewCell.h"
#import "InterFace.h"
#import "UIViewAdditions.h"
@implementation ChargeTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        
        [self createrChargeUI:CGRectMake(0, self.money.frame.size.height, SCREEN_WIDTH-20,1)];
        if (SCREEN_WIDTH == 320) {
            self.date = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
        }else if (SCREEN_WIDTH == 375){
            self.date = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 118, 30)];
        }else{
            self.date = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 131, 30)];
        }
        self.date.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.date];
        self.date.font = [UIFont systemFontOfSize:12];
        
        [self createrChargeUI:CGRectMake(self.date.right, 0, 1, 30)];
        if (SCREEN_WIDTH == 320) {
            self.time = [[UILabel alloc] initWithFrame:CGRectMake(self.date.right, 0, 100, 30)];
        }else if (SCREEN_WIDTH == 375){
            self.time = [[UILabel alloc] initWithFrame:CGRectMake(self.date.right, 0, 118, 30)];
        }else{
            self.time = [[UILabel alloc] initWithFrame:CGRectMake(self.date.right, 0, 131, 30)];
        }
        self.time.textAlignment = NSTextAlignmentCenter;
        self.time.font = [UIFont systemFontOfSize:12];
        [self addSubview:self.time];
        
        [self createrChargeUI:CGRectMake(self.time.right, 0, 1,30)];
        if (SCREEN_WIDTH == 320) {
            self.money = [[UILabel alloc] initWithFrame:CGRectMake(self.time.right, 0,100, 30)];
        }else if (SCREEN_WIDTH == 375){
            self.money = [[UILabel alloc] initWithFrame:CGRectMake(self.time.right, 0,118, 30)];
        }else{
            self.money = [[UILabel alloc] initWithFrame:CGRectMake(self.time.right, 0,131, 30)];
        }
        self.money.textAlignment = NSTextAlignmentCenter;
        self.money.font = [UIFont systemFontOfSize:12];
        [self addSubview:self.money];
        if (SCREEN_WIDTH == 320) {
            [self createrChargeUI:CGRectMake(self.money.right-1, 0, 1,30)];

        }else if (SCREEN_WIDTH == 375){
            [self createrChargeUI:CGRectMake(self.money.right, 0, 1,30)];

        }else{
            [self createrChargeUI:CGRectMake(self.money.right, 0, 1,30)];
        }
        
        [self createrChargeUI:CGRectMake(0, self.money.frame.size.height, SCREEN_WIDTH-20,1)];
        [self createrChargeUI:CGRectMake(0, self.money.bottom, SCREEN_WIDTH-20,1)];
        [self createrChargeUI:CGRectMake(0, 0, 1,30)];
        
    }
    return self;
}

-(void)createrChargeUI:(CGRect)rect{
    UIView *lines = [[UIView alloc] initWithFrame:rect];
    lines.backgroundColor = [UIColor colorWithRed:179/255.0 green:179/255.0 blue:179/255.0 alpha:1];
    [self addSubview:lines];
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
